package com.shangyueshang.model;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.shangyueshang.converter.LocalDateConverter;
import lombok.*;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.YearMonth;

/**
 * @author: JokeyZheng
 * @email: zhengjingfeng@ruqimobility.com
 * @created: 2023/5/17 11:53
 * @version: v1.0.0
 *
 * <p>商品广告成本统计表</p>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GoodsAdvertiseFee extends BaseModel implements BaseShopSkuKey {
	
	/**
	 * 店铺名称
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "店铺")
	private String shop;
	
	/**
	 * 自由sku
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "SKU")
	private String sku;
	
	/**
	 * 平台asin
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "ASIN")
	private String asin;
	
	/**
	 * 开始日期
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "开始日期", converter = LocalDateConverter.class)
	private LocalDate fromDate;
	
	/**
	 * 结束日期
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "结束日期", converter = LocalDateConverter.class)
	private LocalDate toDate;
	
	/**
	 * 广告活动名称
	 */
	@ExcelIgnore
	@ColumnWidth(20)
	@ExcelProperty(value = "广告活动名称")
	private String advertiseName;
	
	/**
	 * 展示量
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "展示量")
	private Long impressions;
	
	/**
	 * 点击量
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "点击量")
	private Long hits;
	
	/**
	 * 花费
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "花费")
	private BigDecimal cost;
	
	/**
	 * 货币类型
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "货币类型")
	private String currency;
	
	/**
	 * 兑换rmb的汇率
	 */
	@ExcelIgnore
	private BigDecimal exchangeRate;
	
	/**
	 * 表中不存在该字段
	 */
	@ExcelIgnore
	@TableField(exist = false)
	private YearMonth tradeMonth;
	
	@Override
	public String shopSkuKey() {
		return this.shop + "-" + this.sku;
	}
	
}
